package com.xyyhome.web.system.domain;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by ty850 on 2017/5/21.
 */
@Entity
@Table(name = "y_s_msg", schema = "xyyhome", catalog = "")
public class YSMsg {
    private String ysmId;
    private String ysmTargetId;
    private String ysmType;
    private String ysmTitle;
    private String ysmContent;
    private Byte ysmState;
    private Timestamp ysmCreatTime;
    private Timestamp ysmSeeTime;

    @Id
    @Column(name = "ysm_id", nullable = false, length = 36)
    public String getYsmId() {
        return ysmId;
    }

    public void setYsmId(String ysmId) {
        this.ysmId = ysmId;
    }

    @Basic
    @Column(name = "ysm_target_id", nullable = true, length = 36)
    public String getYsmTargetId() {
        return ysmTargetId;
    }

    public void setYsmTargetId(String ysmTargetId) {
        this.ysmTargetId = ysmTargetId;
    }

    @Basic
    @Column(name = "ysm_type", nullable = true, length = 10)
    public String getYsmType() {
        return ysmType;
    }

    public void setYsmType(String ysmType) {
        this.ysmType = ysmType;
    }

    @Basic
    @Column(name = "ysm_title", nullable = true, length = 50)
    public String getYsmTitle() {
        return ysmTitle;
    }

    public void setYsmTitle(String ysmTitle) {
        this.ysmTitle = ysmTitle;
    }

    @Basic
    @Column(name = "ysm_content", nullable = true, length = 200)
    public String getYsmContent() {
        return ysmContent;
    }

    public void setYsmContent(String ysmContent) {
        this.ysmContent = ysmContent;
    }

    @Basic
    @Column(name = "ysm_state", nullable = true)
    public Byte getYsmState() {
        return ysmState;
    }

    public void setYsmState(Byte ysmState) {
        this.ysmState = ysmState;
    }

    @Basic
    @Column(name = "ysm_creat_time", nullable = true)
    public Timestamp getYsmCreatTime() {
        return ysmCreatTime;
    }

    public void setYsmCreatTime(Timestamp ysmCreatTime) {
        this.ysmCreatTime = ysmCreatTime;
    }

    @Basic
    @Column(name = "ysm_see_time", nullable = true)
    public Timestamp getYsmSeeTime() {
        return ysmSeeTime;
    }

    public void setYsmSeeTime(Timestamp ysmSeeTime) {
        this.ysmSeeTime = ysmSeeTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        YSMsg ysMsg = (YSMsg) o;

        if (ysmId != null ? !ysmId.equals(ysMsg.ysmId) : ysMsg.ysmId != null) return false;
        if (ysmTargetId != null ? !ysmTargetId.equals(ysMsg.ysmTargetId) : ysMsg.ysmTargetId != null) return false;
        if (ysmType != null ? !ysmType.equals(ysMsg.ysmType) : ysMsg.ysmType != null) return false;
        if (ysmTitle != null ? !ysmTitle.equals(ysMsg.ysmTitle) : ysMsg.ysmTitle != null) return false;
        if (ysmContent != null ? !ysmContent.equals(ysMsg.ysmContent) : ysMsg.ysmContent != null) return false;
        if (ysmState != null ? !ysmState.equals(ysMsg.ysmState) : ysMsg.ysmState != null) return false;
        if (ysmCreatTime != null ? !ysmCreatTime.equals(ysMsg.ysmCreatTime) : ysMsg.ysmCreatTime != null) return false;
        if (ysmSeeTime != null ? !ysmSeeTime.equals(ysMsg.ysmSeeTime) : ysMsg.ysmSeeTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = ysmId != null ? ysmId.hashCode() : 0;
        result = 31 * result + (ysmTargetId != null ? ysmTargetId.hashCode() : 0);
        result = 31 * result + (ysmType != null ? ysmType.hashCode() : 0);
        result = 31 * result + (ysmTitle != null ? ysmTitle.hashCode() : 0);
        result = 31 * result + (ysmContent != null ? ysmContent.hashCode() : 0);
        result = 31 * result + (ysmState != null ? ysmState.hashCode() : 0);
        result = 31 * result + (ysmCreatTime != null ? ysmCreatTime.hashCode() : 0);
        result = 31 * result + (ysmSeeTime != null ? ysmSeeTime.hashCode() : 0);
        return result;
    }
}
